/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package beans.person;

/**
 *
 * @author Administrador
 */
public class Person {
    private String name;
    private String surname1;
    private String surname2;
    private String documentType;
    private String document;
    private String address;
    private String city;
    private String country;
    private String zipCode;
    private String phone;
    private String email;
    

    public Person() {
    }

    public Person(String name, String surname1, String surname2, String documentType, String document, String address, String city, String country, String zipCode,String phone,String email) {
        this.name = name;
        this.surname1 = surname1;
        this.surname2 = surname2;
        this.documentType = documentType;
        this.document = document;
        this.address = address;
        this.city = city;
        this.country = country;
        this.zipCode = zipCode;
        this.phone=phone;
        this.email=email;
    }
    
    public String getAddress() {
        return address!=null?address:"";
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCity() {
        return city!=null?city:"";
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country!=null?country:"";
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getDocument() {
        return document;
    }

    public void setDocument(String document) {
        this.document = document;
    }

    public String getDocumentType() {
        return documentType;
    }

    public void setDocumentType(String documentType) {
        this.documentType = documentType;
    }

    public String getName() {
        return name!=null?name:"";
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSurname1() {
        return surname1!=null?surname1:"";
    }

    public void setSurname1(String surname1) {
        this.surname1 = surname1;
    }

    public String getSurname2() {
        return surname2!=null?surname2:"";
    }

    public void setSurname2(String surname2) {
        this.surname2 = surname2;
    }

    public String getZipCode() {
        return zipCode!=null?zipCode:"";
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
    

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Person other = (Person) obj;
        if ((this.documentType == null) ? (other.documentType != null) : !this.documentType.equals(other.documentType)) {
            return false;
        }
        if ((this.document == null) ? (other.document != null) : !this.document.equals(other.document)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        return hash;
    }

    @Override
    public String toString() {
        if (this.getName().equals("")){
            return this.getSurname1()+ " "+this.getSurname2();
        }else{
            return this.getSurname1()+ " "+this.getSurname2()+", "+this.getName();
        }
    }
    
}
